#define _CRT_SECURE_NO_WARNINGS 1


#include<stdio.h>
#include<string.h>
#include<stdlib.h>

char* longestCommonPrefix(char** strs, int strsSize)
{
    char* RetArr = (char*)malloc(sizeof(char) * 202);
    int i = 0, j = 0, flag = 0, k = 0, len = 0;
    for (i = 0; i < strsSize; i++)
    {
        flag = 1;
        for (j = 1; j < strsSize; j++)
        {
            if (strs[i][k] != strs[j][k])
            {
                flag = 0;
                break;
            }
        }
        if (flag == 1)
        {
            RetArr[len++] = strs[i][k];
        }
        k++;
    }
    return RetArr;
}

int main()
{
	char* arr[] = { "flower","flow","flight" };
    printf("%s\n", longestCommonPrefix(arr, 3));
	return 0;
}